package com.huawei.Galenus.service.impl;

import com.huawei.Galenus.dao.SongRepository;
import com.huawei.Galenus.domain.Song;
import com.huawei.Galenus.domain.Song1;
import com.huawei.Galenus.service.SongService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("SongService")
public class SongServiceImpl implements SongService {

    @Autowired
    private SongRepository songRepository;

    @Override
    public Boolean save(Song1 song) {
        return songRepository.save(song) == 1 ? Boolean.TRUE : Boolean.FALSE;
    }

    @Override
    public Song1 getById(String id) {
        return songRepository.selectById(id);
    }

    @Override
    public List<Song1> getAllSongs() {
        return songRepository.selectSongs();
    }

}
